home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / N-P / Open Prolog 1.02.sit / Open Prolog 1.02 / External Predicates… / About External Predicates next >
MacBinary  |  1993-10-05  |  11.0 KB  |  [TEXT/PRLG]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Tue Oct 5 23:19:11 1993, modified Tue Oct 5 23:19:11 1993, creator 'PRLG', type ASCII, 10631 bytes "About External Predicates" , at 0x2a07 354 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[PRLG]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 19 41 62 6f 75 74 20 | 45 78 74 65 72 6e 61 6c |..About |External|
|00000010| 20 50 72 65 64 69 63 61 | 74 65 73 00 00 00 00 00 | Predica|tes.....|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 50 52 4c | 47 01 00 00 00 00 00 00 |.TEXTPRL|G.......|
|00000050| 00 00 00 00 00 29 87 00 | 00 01 62 a8 d7 e9 af a8 |.....)..|..b.....|
|00000060| d7 e9 af 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 e1 73 00 00 |........|.....s..|
|00000080| a5 20 45 78 74 65 72 6e | 61 6c 20 50 72 65 64 69 |. Extern|al Predi|
|00000090| 63 61 74 65 73 20 69 6e | 20 4f 70 65 6e 20 50 72 |cates in| Open Pr|
|000000a0| 6f 6c 6f 67 0d 0d 54 68 | 65 20 76 65 72 73 69 6f |olog..Th|e versio|
|000000b0| 6e 20 6f 66 20 4f 70 65 | 6e 20 50 72 6f 6c 6f 67 |n of Ope|n Prolog|
|000000c0| 20 74 6f 20 77 68 69 63 | 68 20 74 68 69 73 20 64 | to whic|h this d|
|000000d0| 6f 63 75 6d 65 6e 74 20 | 72 65 66 65 72 73 20 69 |ocument |refers i|
|000000e0| 73 20 67 69 76 65 6e 20 | 69 6e 20 74 68 65 20 47 |s given |in the G|
|000000f0| 65 74 20 49 6e 66 6f c9 | 20 69 6e 66 6f 72 6d 61 |et Info.| informa|
|00000100| 74 69 6f 6e 20 66 6f 72 | 20 74 68 69 73 20 64 6f |tion for| this do|
|00000110| 63 75 6d 65 6e 74 2e 0d | 0d 54 68 65 20 66 6f 6c |cument..|.The fol|
|00000120| 6c 6f 77 69 6e 67 20 6e | 6f 74 65 73 20 61 72 65 |lowing n|otes are|
|00000130| 20 66 6f 72 20 70 65 6f | 70 6c 65 20 77 68 6f 20 | for peo|ple who |
|00000140| 6b 6e 6f 77 20 77 68 61 | 74 20 74 68 65 79 27 72 |know wha|t they'r|
|00000150| 65 20 64 6f 69 6e 67 2e | 0d 59 6f 75 20 61 72 65 |e doing.|.You are|
|00000160| 20 61 64 76 69 73 65 64 | 20 74 6f 20 77 6f 72 6b | advised| to work|
|00000170| 20 6f 6e 20 61 20 63 6f | 70 79 20 6f 66 20 4f 70 | on a co|py of Op|
|00000180| 65 6e 20 50 72 6f 6c 6f | 67 2e 0d 0d 57 65 27 64 |en Prolo|g...We'd|
|00000190| 20 76 65 72 79 20 6d 75 | 63 68 20 6c 69 6b 65 20 | very mu|ch like |
|000001a0| 74 6f 20 68 65 61 72 20 | 77 68 61 74 20 79 6f 75 |to hear |what you|
|000001b0| 20 61 72 65 20 75 73 69 | 6e 67 20 45 78 74 65 72 | are usi|ng Exter|
|000001c0| 6e 61 6c 20 50 72 65 64 | 69 63 61 74 65 73 20 66 |nal Pred|icates f|
|000001d0| 6f 72 2e 0d 46 65 65 6c | 20 66 72 65 65 20 74 6f |or..Feel| free to|
|000001e0| 20 6d 61 69 6c 20 75 73 | 20 61 62 6f 75 74 20 69 | mail us| about i|
|000001f0| 74 20 28 61 64 64 72 65 | 73 73 20 62 65 6c 6f 77 |t (addre|ss below|
|00000200| 29 2e 0d 0d 54 68 65 72 | 65 20 61 72 65 20 66 6f |)...Ther|e are fo|
|00000210| 75 72 20 73 61 6d 70 6c | 65 20 45 78 74 65 72 6e |ur sampl|e Extern|
|00000220| 61 6c 20 50 72 65 64 69 | 63 61 74 65 73 20 61 63 |al Predi|cates ac|
|00000230| 63 6f 6d 70 61 6e 79 69 | 6e 67 20 74 68 69 73 20 |companyi|ng this |
|00000240| 72 65 6c 65 61 73 65 2e | 0d 0d a9 20 4d 69 6b 65 |release.|... Mike|
|00000250| 20 42 72 61 64 79 2c 20 | 31 39 39 30 2d 39 33 2e | Brady, |1990-93.|
|00000260| 0d 0d 43 6f 6e 74 61 63 | 74 20 41 64 64 72 65 73 |..Contac|t Addres|
|00000270| 73 65 73 0d 4d 69 6b 65 | 20 42 72 61 64 79 20 28 |ses.Mike| Brady (|
|00000280| 61 75 74 68 6f 72 20 6f | 66 20 4f 70 65 6e 20 50 |author o|f Open P|
|00000290| 72 6f 6c 6f 67 29 3a 20 | 62 72 61 64 79 40 63 73 |rolog): |brady@cs|
|000002a0| 2e 74 63 64 2e 69 65 0d | 50 68 79 73 69 63 61 6c |.tcd.ie.|Physical|
|000002b0| 20 41 64 64 72 65 73 73 | 3a 20 44 65 70 61 72 74 | Address|: Depart|
|000002c0| 6d 65 6e 74 20 6f 66 20 | 43 6f 6d 70 75 74 65 72 |ment of |Computer|
|000002d0| 20 53 63 69 65 6e 63 65 | 2c 20 54 72 69 6e 69 74 | Science|, Trinit|
|000002e0| 79 20 43 6f 6c 6c 65 67 | 65 2c 20 44 75 62 6c 69 |y Colleg|e, Dubli|
|000002f0| 6e 2c 20 49 72 65 6c 61 | 6e 64 2e 0d 4f 70 65 6e |n, Irela|nd..Open|
|00000300| 20 50 72 6f 6c 6f 67 20 | 46 54 50 20 73 69 74 65 | Prolog |FTP site|
|00000310| 3a 20 67 72 61 74 74 61 | 6e 2e 63 73 2e 74 63 64 |: gratta|n.cs.tcd|
|00000320| 2e 69 65 20 28 31 33 34 | 2e 32 32 36 2e 33 32 2e |.ie (134|.226.32.|
|00000330| 31 35 29 2e 0d 53 75 62 | 64 69 72 65 63 74 6f 72 |15)..Sub|director|
|00000340| 79 3a 20 70 75 62 2f 6c | 61 6e 67 75 61 67 65 73 |y: pub/l|anguages|
|00000350| 2f 6f 70 65 6e 2d 70 72 | 6f 6c 6f 67 0d 0d a5 20 |/open-pr|olog... |
|00000360| 47 65 6e 65 72 61 6c 0d | 4f 70 65 6e 20 50 72 6f |General.|Open Pro|
|00000370| 6c 6f 67 27 73 20 45 78 | 74 65 72 6e 61 6c 20 50 |log's Ex|ternal P|
|00000380| 72 65 64 69 63 61 74 65 | 20 49 6e 74 65 72 66 61 |redicate| Interfa|
|00000390| 63 65 20 65 6e 61 62 6c | 65 73 20 70 72 6f 67 72 |ce enabl|es progr|
|000003a0| 61 6d 6d 65 72 73 20 74 | 6f 20 61 64 64 20 70 72 |ammers t|o add pr|
|000003b0| 6f 63 65 64 75 72 61 6c | 20 70 72 65 64 69 63 61 |ocedural| predica|
|000003c0| 74 65 73 2c 20 63 61 6c | 6c 65 64 20 45 78 74 65 |tes, cal|led Exte|
|000003d0| 72 6e 61 6c 20 50 72 65 | 64 69 63 61 74 65 73 2c |rnal Pre|dicates,|
|000003e0| 20 74 6f 20 4f 70 65 6e | 20 50 72 6f 6c 6f 67 20 | to Open| Prolog |
|000003f0| 77 69 74 68 6f 75 74 20 | 6e 65 65 64 69 6e 67 20 |without |needing |
|00000400| 61 63 63 65 73 73 20 74 | 6f 20 4f 70 65 6e 20 50 |access t|o Open P|
|00000410| 72 6f 6c 6f 67 27 73 20 | 73 6f 75 72 63 65 20 63 |rolog's |source c|
|00000420| 6f 64 65 20 6f 72 20 6c | 69 6e 6b 20 6c 69 62 72 |ode or l|ink libr|
|00000430| 61 72 69 65 73 2e 0d 0d | 45 78 74 65 72 6e 61 6c |aries...|External|
|00000440| 20 50 72 65 64 69 63 61 | 74 65 73 20 61 72 65 20 | Predica|tes are |
|00000450| 63 6f 6e 74 61 69 6e 65 | 64 20 69 6e 20 50 52 4c |containe|d in PRL|
|00000460| 58 20 72 65 73 6f 75 72 | 63 65 73 3b 20 61 20 50 |X resour|ces; a P|
|00000470| 52 4c 58 20 72 65 73 6f | 75 72 63 65 20 63 61 6e |RLX reso|urce can|
|00000480| 20 63 6f 6e 74 61 69 6e | 20 6f 6e 65 20 6f 72 20 | contain| one or |
|00000490| 6d 6f 72 65 20 65 78 74 | 65 72 6e 61 6c 20 70 72 |more ext|ernal pr|
|000004a0| 65 64 69 63 61 74 65 73 | 2e 0d 0d 41 6c 6c 20 45 |edicates|...All E|
|000004b0| 78 74 65 72 6e 61 6c 20 | 50 72 65 64 69 63 61 74 |xternal |Predicat|
|000004c0| 65 73 20 74 68 61 74 20 | 68 61 76 65 20 62 65 65 |es that |have bee|
|000004d0| 6e 20 77 72 69 74 74 65 | 6e 20 73 6f 20 66 61 72 |n writte|n so far|
|000004e0| 20 68 61 76 65 20 62 65 | 65 6e 20 77 72 69 74 74 | have be|en writt|
|000004f0| 65 6e 20 69 6e 20 4d 50 | 57 20 50 61 73 63 61 6c |en in MP|W Pascal|
|00000500| 20 61 6e 64 20 64 65 62 | 75 67 67 65 64 20 75 73 | and deb|ugged us|
|00000510| 69 6e 67 20 53 41 44 45 | 2e 20 41 6c 74 68 6f 75 |ing SADE|. Althou|
|00000520| 67 68 20 79 6f 75 20 6d | 61 79 20 66 69 6e 64 20 |gh you m|ay find |
|00000530| 74 68 65 73 65 20 70 72 | 6f 64 75 63 74 73 20 27 |these pr|oducts '|
|00000540| 63 6c 75 6e 6b 79 27 2c | 20 74 68 65 79 20 61 72 |clunky',| they ar|
|00000550| 65 20 76 65 72 79 20 70 | 6f 77 65 72 66 75 6c 20 |e very p|owerful |
|00000560| 61 6e 64 20 71 75 69 74 | 65 20 72 65 6c 69 61 62 |and quit|e reliab|
|00000570| 6c 65 2e 20 48 6f 77 65 | 76 65 72 2c 20 79 6f 75 |le. Howe|ver, you|
|00000580| 27 6c 6c 20 6e 65 65 64 | 20 61 20 36 38 30 32 30 |'ll need| a 68020|
|00000590| 2f 33 30 2f 34 30 2c 20 | 61 20 48 61 72 64 20 44 |/30/40, |a Hard D|
|000005a0| 69 73 6b 20 61 6e 64 20 | 38 4d 42 20 52 41 4d 20 |isk and |8MB RAM |
|000005b0| 74 6f 20 67 65 74 20 61 | 6e 79 77 68 65 72 65 20 |to get a|nywhere |
|000005c0| 77 69 74 68 20 74 68 65 | 6d 2e 0d 54 68 65 20 69 |with the|m..The i|
|000005d0| 6e 74 65 72 66 61 63 65 | 2c 20 6c 69 62 72 61 72 |nterface|, librar|
|000005e0| 79 20 61 6e 64 20 6d 61 | 6b 65 20 66 69 6c 65 73 |y and ma|ke files|
|000005f0| 2c 20 74 6f 67 65 74 68 | 65 72 20 77 69 74 68 20 |, togeth|er with |
|00000600| 74 68 65 20 73 61 6d 70 | 6c 65 73 2c 20 68 61 76 |the samp|les, hav|
|00000610| 65 20 61 6c 6c 20 62 65 | 65 6e 20 77 72 69 74 74 |e all be|en writt|
|00000620| 65 6e 20 66 6f 72 20 4d | 50 57 20 33 2e 32 2e 0d |en for M|PW 3.2..|
|00000630| 0d a5 20 4d 6f 64 65 73 | 20 6f 66 20 4f 70 65 72 |.. Modes| of Oper|
|00000640| 61 74 69 6f 6e 2e 0d 45 | 78 74 65 72 6e 61 6c 20 |ation..E|xternal |
|00000650| 50 72 65 64 69 63 61 74 | 65 73 20 61 72 65 20 63 |Predicat|es are c|
|00000660| 6f 6e 74 61 69 6e 65 64 | 20 69 6e 20 50 52 4c 58 |ontained| in PRLX|
|00000670| 20 72 65 73 6f 75 72 63 | 65 73 20 61 6e 64 20 6e | resourc|es and n|
|00000680| 6f 72 6d 61 6c 20 63 6f | 64 65 20 65 78 65 63 75 |ormal co|de execu|
|00000690| 74 69 6f 6e 20 62 65 67 | 69 6e 73 20 61 74 20 74 |tion beg|ins at t|
|000006a0| 68 65 20 66 69 72 73 74 | 20 62 79 74 65 20 6f 66 |he first| byte of|
|000006b0| 20 74 68 65 20 72 65 73 | 6f 75 72 63 65 2e 0d 0d | the res|ource...|
|000006c0| 45 78 74 65 72 6e 61 6c | 20 50 72 65 64 69 63 61 |External| Predica|
|000006d0| 74 65 20 63 6f 64 65 20 | 63 61 6e 20 65 78 65 63 |te code |can exec|
|000006e0| 75 74 65 20 75 6e 64 65 | 72 20 74 68 72 65 65 20 |ute unde|r three |
|000006f0| 64 69 73 74 69 6e 63 74 | 20 73 65 74 73 20 6f 66 |distinct| sets of|
|00000700| 20 63 6f 6e 64 69 74 69 | 6f 6e 73 2c 20 6f 72 20 | conditi|ons, or |
|00000710| 6d 6f 64 65 73 3b 20 74 | 68 65 79 20 61 72 65 20 |modes; t|hey are |
|00000720| 28 31 29 20 4e 6f 72 6d | 61 6c 20 4f 70 65 72 61 |(1) Norm|al Opera|
|00000730| 74 69 6f 6e 2c 20 28 32 | 29 20 57 69 6e 64 6f 77 |tion, (2|) Window|
|00000740| 2d 44 72 69 76 65 6e 20 | 4f 70 65 72 61 74 69 6f |-Driven |Operatio|
|00000750| 6e 2c 20 28 33 29 20 45 | 76 65 6e 74 2d 44 72 69 |n, (3) E|vent-Dri|
|00000760| 76 65 6e 20 4f 70 65 72 | 61 74 69 6f 6e 2e 0d 0d |ven Oper|ation...|
|00000770| 49 4d 50 4f 52 54 41 4e | 54 3a 20 49 66 20 79 6f |IMPORTAN|T: If yo|
|00000780| 75 72 20 70 72 65 64 69 | 63 61 74 65 20 68 61 73 |ur predi|cate has|
|00000790| 20 57 69 6e 64 6f 77 2d | 44 72 69 76 65 6e 20 6f | Window-|Driven o|
|000007a0| 72 20 45 76 65 6e 74 2d | 44 72 69 76 65 6e 20 4f |r Event-|Driven O|
|000007b0| 70 65 72 61 74 69 6f 6e | 20 6d 6f 64 65 73 2c 20 |peration| modes, |
|000007c0| 74 68 65 6e 20 74 68 65 | 20 50 52 4c 58 20 72 65 |then the| PRLX re|
|000007d0| 73 6f 75 72 63 65 20 63 | 6f 6e 74 61 69 6e 69 6e |source c|ontainin|
|000007e0| 67 20 69 74 20 6d 75 73 | 74 20 62 65 20 6c 6f 63 |g it mus|t be loc|
|000007f0| 6b 65 64 20 61 6e 64 20 | 70 72 65 6c 6f 61 64 65 |ked and |preloade|
|00000800| 64 2e 20 49 66 20 79 6f | 75 20 61 72 65 6e 27 74 |d. If yo|u aren't|
|00000810| 20 75 73 69 6e 67 20 4d | 50 57 2c 20 74 68 65 6e | using M|PW, then|
|00000820| 20 79 6f 75 20 63 61 6e | 20 73 65 74 20 74 68 65 | you can| set the|
|00000830| 20 6c 6f 63 6b 20 61 6e | 64 20 70 72 65 6c 6f 61 | lock an|d preloa|
|00000840| 64 20 62 69 74 73 20 75 | 73 69 6e 67 20 52 65 73 |d bits u|sing Res|
|00000850| 45 64 69 74 2e 20 49 66 | 20 79 6f 75 20 64 6f 6e |Edit. If| you don|
|00000860| 27 74 20 6c 6f 63 6b 20 | 73 75 63 68 20 70 72 65 |'t lock |such pre|
|00000870| 64 69 63 61 74 65 73 2c | 20 74 68 65 6e 20 74 68 |dicates,| then th|
|00000880| 65 20 63 6f 64 65 20 77 | 69 6c 6c 20 62 65 20 6d |e code w|ill be m|
|00000890| 6f 76 65 64 20 61 72 6f | 75 6e 64 20 64 75 72 69 |oved aro|und duri|
|000008a0| 6e 67 20 65 78 65 63 75 | 74 69 6f 6e 2c 20 6c 65 |ng execu|tion, le|
|000008b0| 61 64 69 6e 67 20 74 6f | 20 64 61 6e 67 6c 69 6e |ading to| danglin|
|000008c0| 67 20 70 6f 69 6e 74 65 | 72 73 2e 20 49 66 20 70 |g pointe|rs. If p|
|000008d0| 72 65 6c 6f 61 64 20 69 | 73 6e 27 74 20 63 68 6f |reload i|sn't cho|
|000008e0| 73 65 6e 20 66 6f 72 20 | 6c 6f 63 6b 65 64 20 72 |sen for |locked r|
|000008f0| 65 73 6f 75 72 63 65 73 | 2c 20 79 6f 75 27 6c 6c |esources|, you'll|
|00000900| 20 67 65 74 20 6d 65 6d | 6f 72 79 20 66 72 61 67 | get mem|ory frag|
|00000910| 6d 65 6e 74 61 74 69 6f | 6e 20 61 6e 64 20 27 4f |mentatio|n and 'O|
|00000920| 75 74 20 6f 66 20 4d 65 | 6d 6f 72 79 27 20 65 72 |ut of Me|mory' er|
|00000930| 72 6f 72 73 2e 0d 0d 0d | d7 20 4e 6f 72 6d 61 6c |rors....|. Normal|
|00000940| 20 4f 70 65 72 61 74 69 | 6f 6e 0d 49 6e 20 4e 6f | Operati|on.In No|
|00000950| 72 6d 61 6c 20 4f 70 65 | 72 61 74 69 6f 6e 2c 20 |rmal Ope|ration, |
|00000960| 74 68 65 20 50 52 4c 58 | 20 63 6f 64 65 20 69 73 |the PRLX| code is|
|00000970| 20 61 6c 77 61 79 73 20 | 63 61 6c 6c 65 64 20 61 | always |called a|
|00000980| 73 20 61 20 66 75 6e 63 | 74 69 6f 6e 20 74 6f 20 |s a func|tion to |
|00000990| 77 68 69 63 68 20 61 20 | 70 61 72 61 6d 65 74 65 |which a |paramete|
|000009a0| 72 20 6c 69 73 74 20 6f | 66 20 74 79 70 65 20 70 |r list o|f type p|
|000009b0| 72 6c 78 52 65 63 6f 72 | 64 20 28 67 65 6e 65 72 |rlxRecor|d (gener|
|000009c0| 61 6c 6c 79 20 63 61 6c | 6c 65 64 20 70 6c 69 73 |ally cal|led plis|
|000009d0| 74 29 20 69 73 20 70 61 | 73 73 65 64 2e 20 54 68 |t) is pa|ssed. Th|
|000009e0| 65 20 70 61 72 61 6d 65 | 74 65 72 20 6c 69 73 74 |e parame|ter list|
|000009f0| 20 69 73 20 74 68 65 20 | 63 68 61 6e 6e 65 6c 20 | is the |channel |
|00000a00| 74 68 72 6f 75 67 68 20 | 77 68 69 63 68 20 64 61 |through |which da|
|00000a10| 74 61 20 61 6e 64 20 63 | 6f 6d 6d 61 6e 64 73 20 |ta and c|ommands |
|00000a20| 63 61 6e 20 62 65 20 70 | 61 73 73 65 64 20 62 65 |can be p|assed be|
|00000a30| 74 77 65 65 6e 20 4f 70 | 65 6e 20 50 72 6f 6c 6f |tween Op|en Prolo|
|00000a40| 67 20 61 6e 64 20 74 68 | 65 20 70 72 65 64 69 63 |g and th|e predic|
|00000a50| 61 74 65 2e 20 43 61 6c | 6c 62 61 63 6b 20 63 6f |ate. Cal|lback co|
|00000a60| 6d 6d 61 6e 64 73 20 61 | 72 65 20 61 76 61 69 6c |mmands a|re avail|
|00000a70| 61 62 6c 65 20 74 6f 20 | 61 6c 6c 6f 77 20 74 68 |able to |allow th|
|00000a80| 65 20 70 72 65 64 69 63 | 61 74 65 20 74 6f 20 71 |e predic|ate to q|
|00000a90| 75 65 72 79 20 4f 70 65 | 6e 20 50 72 6f 6c 6f 67 |uery Ope|n Prolog|
|00000aa0| 2e 20 57 68 69 6c 65 20 | 61 20 70 72 65 64 69 63 |. While |a predic|
|00000ab0| 61 74 65 20 69 73 20 61 | 63 74 69 76 65 2c 20 4f |ate is a|ctive, O|
|00000ac0| 70 65 6e 20 50 72 6f 6c | 6f 67 20 69 73 20 73 75 |pen Prol|og is su|
|00000ad0| 73 70 65 6e 64 65 64 2e | 20 43 61 6c 6c 62 61 63 |spended.| Callbac|
|00000ae0| 6b 20 63 6f 6d 6d 61 6e | 64 73 20 61 72 65 20 67 |k comman|ds are g|
|00000af0| 65 6e 65 72 61 6c 6c 79 | 20 61 76 61 69 6c 61 62 |enerally| availab|
|00000b00| 6c 65 20 64 75 72 69 6e | 67 20 74 68 65 20 43 61 |le durin|g the Ca|
|00000b10| 6c 6c 20 50 68 61 73 65 | 20 6f 66 20 4e 6f 72 6d |ll Phase| of Norm|
|00000b20| 61 6c 20 4f 70 65 72 61 | 74 69 6f 6e 2e 0d 0d 54 |al Opera|tion...T|
|00000b30| 68 65 72 65 20 61 72 65 | 20 74 68 72 65 65 20 64 |here are| three d|
|00000b40| 69 73 74 69 6e 63 74 20 | 70 68 61 73 65 73 20 6f |istinct |phases o|
|00000b50| 66 20 6e 6f 72 6d 61 6c | 20 6f 70 65 72 61 74 69 |f normal| operati|
|00000b60| 6f 6e 20 6f 66 20 65 78 | 74 65 72 6e 61 6c 20 70 |on of ex|ternal p|
|00000b70| 72 65 64 69 63 61 74 65 | 73 3a 0d 28 31 29 20 49 |redicate|s:.(1) I|
|00000b80| 6e 69 74 69 61 6c 69 73 | 61 74 69 6f 6e 3b 20 28 |nitialis|ation; (|
|00000b90| 32 29 20 43 61 6c 6c 3b | 20 28 33 29 20 43 6c 6f |2) Call;| (3) Clo|
|00000ba0| 73 65 64 6f 77 6e 2e 20 | 43 6c 6f 73 65 64 6f 77 |sedown. |Closedow|
|00000bb0| 6e 20 69 73 20 6e 6f 74 | 20 63 75 72 72 65 6e 74 |n is not| current|
|00000bc0| 6c 79 20 69 6d 70 6c 65 | 6d 65 6e 74 65 64 2e 0d |ly imple|mented..|
|00000bd0| 0d a1 20 49 6e 69 74 69 | 61 6c 69 73 61 74 69 6f |.. Initi|alisatio|
|00000be0| 6e 20 50 68 61 73 65 3a | 0d 57 68 65 6e 20 4f 70 |n Phase:|.When Op|
|00000bf0| 65 6e 20 50 72 6f 6c 6f | 67 20 73 74 61 72 74 73 |en Prolo|g starts|
|00000c00| 20 75 70 2c 20 69 74 20 | 65 78 65 63 75 74 65 73 | up, it |executes|
|00000c10| 20 65 61 63 68 20 50 52 | 4c 58 20 72 65 73 6f 75 | each PR|LX resou|
|00000c20| 72 63 65 2c 20 66 69 72 | 73 74 20 61 73 6b 69 6e |rce, fir|st askin|
|00000c30| 67 20 68 6f 77 20 6d 61 | 6e 79 20 70 72 65 64 69 |g how ma|ny predi|
|00000c40| 63 61 74 65 73 20 69 74 | 20 63 6f 6e 74 61 69 6e |cates it| contain|
|00000c50| 73 2c 20 74 68 65 6e 20 | 69 6e 69 74 69 61 6c 69 |s, then |initiali|
|00000c60| 73 69 6e 67 20 65 61 63 | 68 20 6f 6e 65 20 69 6e |sing eac|h one in|
|00000c70| 20 74 75 72 6e 2e 20 44 | 75 72 69 6e 67 20 69 6e | turn. D|uring in|
|00000c80| 69 74 69 61 6c 69 73 61 | 74 69 6f 6e 20 65 61 63 |itialisa|tion eac|
|00000c90| 68 20 70 72 65 64 69 63 | 61 74 65 20 67 69 76 65 |h predic|ate give|
|00000ca0| 73 20 69 74 73 20 6e 61 | 6d 65 2c 20 61 72 69 74 |s its na|me, arit|
|00000cb0| 79 20 61 6e 64 20 70 65 | 72 6d 61 6e 65 6e 74 20 |y and pe|rmanent |
|00000cc0| 64 61 74 61 20 28 6f 6e | 65 20 6c 6f 6e 67 77 6f |data (on|e longwo|
|00000cd0| 72 64 29 2e 20 54 68 65 | 72 65 61 66 74 65 72 2c |rd). The|reafter,|
|00000ce0| 20 74 68 65 20 70 65 72 | 6d 61 6e 65 6e 74 20 64 | the per|manent d|
|00000cf0| 61 74 61 20 77 69 6c 6c | 20 61 6c 77 61 79 73 20 |ata will| always |
|00000d00| 62 65 20 61 76 61 69 6c | 61 62 6c 65 20 69 6e 20 |be avail|able in |
|00000d10| 70 6c 69 73 74 2e 70 65 | 72 6d 61 6e 65 6e 74 44 |plist.pe|rmanentD|
|00000d20| 61 74 61 20 64 75 72 69 | 6e 67 20 6e 6f 72 6d 61 |ata duri|ng norma|
|00000d30| 6c 20 6f 70 65 72 61 74 | 69 6f 6e 2e 20 54 79 70 |l operat|ion. Typ|
|00000d40| 69 63 61 6c 6c 79 2c 20 | 74 68 65 20 70 65 72 6d |ically, |the perm|
|00000d50| 61 6e 65 6e 74 20 64 61 | 74 61 20 77 69 6c 6c 20 |anent da|ta will |
|00000d60| 62 65 20 61 20 68 61 6e | 64 6c 65 20 74 6f 20 64 |be a han|dle to d|
|00000d70| 61 74 61 20 73 74 72 75 | 63 74 75 72 65 73 20 75 |ata stru|ctures u|
|00000d80| 73 65 64 20 62 79 20 74 | 68 65 20 70 72 65 64 69 |sed by t|he predi|
|00000d90| 63 61 74 65 2e 20 46 6f | 72 20 62 61 63 6b 77 61 |cate. Fo|r backwa|
|00000da0| 72 64 20 63 6f 6d 70 61 | 74 69 62 69 6c 69 74 79 |rd compa|tibility|
|00000db0| 2c 20 64 61 74 61 20 73 | 74 6f 72 65 64 20 69 6e |, data s|tored in|
|00000dc0| 20 70 6c 69 73 74 2e 64 | 61 74 61 5b 32 5d 20 69 | plist.d|ata[2] i|
|00000dd0| 73 20 61 6c 73 6f 20 70 | 65 72 6d 61 6e 65 6e 74 |s also p|ermanent|
|00000de0| 3b 20 70 6c 65 61 73 65 | 20 64 6f 6e 27 74 20 75 |; please| don't u|
|00000df0| 73 65 20 74 68 69 73 20 | 66 65 61 74 75 72 65 20 |se this |feature |
|00000e00| 69 6e 20 66 75 74 75 72 | 65 2c 20 61 73 20 69 74 |in futur|e, as it|
|00000e10| 20 6d 61 79 20 64 69 73 | 61 70 70 65 61 72 2e 0d | may dis|appear..|
|00000e20| 0d 45 78 74 65 72 6e 61 | 6c 20 50 72 65 64 69 63 |.Externa|l Predic|
|00000e30| 61 74 65 20 69 6e 74 65 | 72 66 61 63 65 73 20 70 |ate inte|rfaces p|
|00000e40| 72 69 6f 72 20 74 6f 20 | 4f 70 65 6e 20 50 72 6f |rior to |Open Pro|
|00000e50| 6c 6f 67 20 31 2e 30 64 | 33 37 20 64 69 64 6e 27 |log 1.0d|37 didn'|
|00000e60| 74 20 70 72 6f 76 69 64 | 65 20 66 6f 72 20 70 72 |t provid|e for pr|
|00000e70| 65 64 69 63 61 74 65 73 | 20 74 68 61 74 20 77 61 |edicates| that wa|
|00000e80| 6e 74 65 64 20 74 6f 20 | 73 68 61 72 65 20 64 61 |nted to |share da|
|00000e90| 74 61 20 73 74 72 75 63 | 74 75 72 65 73 20 61 6d |ta struc|tures am|
|00000ea0| 6f 6e 67 20 74 68 65 6d | 73 65 6c 76 65 73 20 2d |ong them|selves -|
|00000eb0| 20 66 6f 72 20 65 78 61 | 6d 70 6c 65 2c 20 69 66 | for exa|mple, if|
|00000ec0| 20 61 20 50 52 4c 58 20 | 72 65 73 6f 75 72 63 65 | a PRLX |resource|
|00000ed0| 20 63 6f 6e 74 61 69 6e | 65 64 20 61 20 73 65 74 | contain|ed a set|
|00000ee0| 20 6f 66 20 70 72 65 64 | 69 63 61 74 65 73 20 61 | of pred|icates a|
|00000ef0| 6c 6c 20 72 65 6c 61 74 | 65 64 20 74 6f 20 66 69 |ll relat|ed to fi|
|00000f00| 6c 65 20 68 61 6e 64 6c | 69 6e 67 2c 20 74 68 65 |le handl|ing, the|
|00000f10| 72 65 20 77 61 73 20 6e | 6f 20 77 61 79 20 74 6f |re was n|o way to|
|00000f20| 20 61 6c 6c 6f 77 20 74 | 68 6f 73 65 20 70 72 65 | allow t|hose pre|
|00000f30| 64 69 63 61 74 65 73 20 | 74 6f 20 68 61 76 65 20 |dicates |to have |
|00000f40| 61 63 63 65 73 73 20 74 | 6f 20 61 20 63 6f 6d 6d |access t|o a comm|
|00000f50| 6f 6e 20 64 61 74 61 20 | 73 74 72 75 63 74 75 72 |on data |structur|
|00000f60| 65 20 64 65 73 63 72 69 | 62 69 6e 67 20 74 68 65 |e descri|bing the|
|00000f70| 69 72 20 66 69 6c 65 20 | 73 74 72 75 63 74 75 72 |ir file |structur|
|00000f80| 65 73 2e 20 45 66 66 65 | 63 74 69 76 65 20 66 72 |es. Effe|ctive fr|
|00000f90| 6f 6d 20 4f 70 65 6e 20 | 50 72 6f 6c 6f 67 20 31 |om Open |Prolog 1|
|00000fa0| 2e 30 64 33 37 2c 20 77 | 68 69 6c 65 20 74 68 65 |.0d37, w|hile the|
|00000fb0| 20 70 72 65 64 69 63 61 | 74 65 73 20 69 6e 20 74 | predica|tes in t|
|00000fc0| 68 65 20 73 61 6d 65 20 | 50 52 4c 58 20 72 65 73 |he same |PRLX res|
|00000fd0| 6f 75 72 63 65 20 61 72 | 65 20 62 65 69 6e 67 20 |ource ar|e being |
|00000fe0| 69 6e 69 74 69 61 6c 69 | 73 65 64 2c 20 79 6f 75 |initiali|sed, you|
|00000ff0| 20 61 72 65 20 67 75 61 | 72 61 6e 74 65 65 64 20 | are gua|ranteed |
|00001000| 74 68 61 74 20 70 6c 69 | 73 74 2e 64 61 74 61 5b |that pli|st.data[|
|00001010| 33 5d 20 77 69 6c 6c 20 | 72 65 74 61 69 6e 20 77 |3] will |retain w|
|00001020| 68 61 74 65 76 65 72 20 | 64 61 74 61 20 69 73 20 |hatever |data is |
|00001030| 70 6c 61 63 65 64 20 69 | 6e 20 69 74 20 2a 61 63 |placed i|n it *ac|
|00001040| 72 6f 73 73 20 69 6e 69 | 74 69 61 6c 69 73 61 74 |ross ini|tialisat|
|00001050| 69 6f 6e 20 63 61 6c 6c | 73 2a 2e 20 46 6f 72 20 |ion call|s*. For |
|00001060| 65 78 61 6d 70 6c 65 2c | 20 73 75 70 70 6f 73 65 |example,| suppose|
|00001070| 20 74 68 65 72 65 20 61 | 72 65 20 74 77 6f 20 70 | there a|re two p|
|00001080| 72 65 64 69 63 61 74 65 | 73 20 69 6e 20 61 20 50 |redicate|s in a P|
|00001090| 52 4c 58 20 72 65 73 6f | 75 72 63 65 20 2d 20 66 |RLX reso|urce - f|
|000010a0| 6f 6f 20 61 6e 64 20 62 | 61 72 20 2d 20 61 6e 64 |oo and b|ar - and|
|000010b0| 20 6c 65 74 27 73 20 73 | 61 79 20 66 6f 6f 20 69 | let's s|ay foo i|
|000010c0| 73 20 74 68 65 20 66 69 | 72 73 74 20 70 72 65 64 |s the fi|rst pred|
|000010d0| 69 63 61 74 65 20 61 6e | 64 20 62 61 72 20 69 73 |icate an|d bar is|
|000010e0| 20 74 68 65 20 73 65 63 | 6f 6e 64 2e 20 44 75 72 | the sec|ond. Dur|
|000010f0| 69 6e 67 20 69 6e 69 74 | 69 61 6c 69 73 61 74 69 |ing init|ialisati|
|00001100| 6f 6e 2c 20 4f 50 20 77 | 69 6c 6c 20 63 61 6c 6c |on, OP w|ill call|
|00001110| 20 66 6f 6f 20 61 6e 64 | 20 74 65 6c 6c 20 69 74 | foo and| tell it|
|00001120| 20 74 6f 20 69 6e 69 74 | 69 61 6c 69 73 65 20 69 | to init|ialise i|
|00001130| 74 73 65 6c 66 2e 20 46 | 6f 6f 20 63 6f 75 6c 64 |tself. F|oo could|
|00001140| 20 70 75 74 20 74 68 65 | 20 68 61 6e 64 6c 65 20 | put the| handle |
|00001150| 74 6f 20 61 20 63 6f 6d | 6d 6f 6e 20 64 61 74 61 |to a com|mon data|
|00001160| 20 73 74 72 75 63 74 75 | 72 65 20 69 6e 20 70 6c | structu|re in pl|
|00001170| 69 73 74 2e 64 61 74 61 | 5b 33 5d 20 28 61 73 20 |ist.data|[3] (as |
|00001180| 77 65 6c 6c 20 61 73 20 | 69 6e 74 6f 20 69 74 73 |well as |into its|
|00001190| 20 70 6c 69 73 74 2e 70 | 65 72 6d 61 6e 65 6e 74 | plist.p|ermanent|
|000011a0| 44 61 74 61 20 66 69 65 | 6c 64 29 2e 20 4e 6f 77 |Data fie|ld). Now|
|000011b0| 2c 20 77 68 65 6e 20 62 | 61 72 20 69 73 20 69 6e |, when b|ar is in|
|000011c0| 69 74 69 61 6c 69 73 65 | 64 2c 20 70 6c 69 73 74 |itialise|d, plist|
|000011d0| 2e 64 61 74 61 5b 33 5d | 20 77 69 6c 6c 20 73 74 |.data[3]| will st|
|000011e0| 69 6c 6c 20 63 6f 6e 74 | 61 69 6e 20 74 68 65 20 |ill cont|ain the |
|000011f0| 68 61 6e 64 6c 65 20 70 | 6c 61 63 65 64 20 69 6e |handle p|laced in|
|00001200| 20 69 74 20 62 79 20 74 | 68 65 20 69 6e 69 74 69 | it by t|he initi|
|00001210| 61 6c 69 73 61 74 69 6f | 6e 20 6f 66 20 66 6f 6f |alisatio|n of foo|
|00001220| 2e 20 49 74 20 63 6f 75 | 6c 64 20 74 68 65 6e 20 |. It cou|ld then |
|00001230| 62 65 20 74 72 61 6e 73 | 66 65 72 72 65 64 20 69 |be trans|ferred i|
|00001240| 6e 74 6f 20 62 61 72 27 | 73 20 70 6c 69 73 74 2e |nto bar'|s plist.|
|00001250| 70 65 72 6d 61 6e 65 6e | 74 44 61 74 61 20 66 69 |permanen|tData fi|
|00001260| 65 6c 64 20 69 66 20 64 | 65 73 69 72 65 64 2e 20 |eld if d|esired. |
|00001270| 49 6e 20 74 68 69 73 20 | 77 61 79 2c 20 66 6f 6f |In this |way, foo|
|00001280| 20 61 6e 64 20 62 61 72 | 20 63 6f 75 6c 64 20 72 | and bar| could r|
|00001290| 65 66 65 72 20 74 6f 20 | 74 68 65 20 73 61 6d 65 |efer to |the same|
|000012a0| 20 64 61 74 61 20 73 74 | 72 75 63 74 75 72 65 2e | data st|ructure.|
|000012b0| 0d 0d 42 65 20 61 77 61 | 72 65 20 74 68 61 74 20 |..Be awa|re that |
|000012c0| 74 68 69 73 20 67 75 61 | 72 61 6e 74 65 65 20 6f |this gua|rantee o|
|000012d0| 66 20 74 68 65 20 73 61 | 66 65 6b 65 65 70 69 6e |f the sa|fekeepin|
|000012e0| 67 20 6f 66 20 76 61 6c | 75 65 73 20 69 6e 20 70 |g of val|ues in p|
|000012f0| 6c 69 73 74 2e 64 61 74 | 61 5b 33 5d 20 69 73 20 |list.dat|a[3] is |
|00001300| 6f 6e 6c 79 20 65 66 66 | 65 63 74 69 76 65 20 61 |only eff|ective a|
|00001310| 63 72 6f 73 73 20 69 6e | 69 74 69 61 6c 69 73 61 |cross in|itialisa|
|00001320| 74 69 6f 6e 20 63 61 6c | 6c 73 20 74 6f 20 74 68 |tion cal|ls to th|
|00001330| 65 20 70 72 65 64 69 63 | 61 74 65 73 20 77 69 74 |e predic|ates wit|
|00001340| 68 69 6e 20 61 20 50 52 | 4c 58 20 72 65 73 6f 75 |hin a PR|LX resou|
|00001350| 72 63 65 2e 0d 0d a1 20 | 43 61 6c 6c 20 50 68 61 |rce.... |Call Pha|
|00001360| 73 65 3a 0d 54 68 69 73 | 20 70 68 61 73 65 20 6f |se:.This| phase o|
|00001370| 63 63 75 72 73 20 77 68 | 65 6e 20 74 68 65 20 70 |ccurs wh|en the p|
|00001380| 72 65 64 69 63 61 74 65 | 20 69 73 20 63 61 6c 6c |redicate| is call|
|00001390| 65 64 20 64 75 72 69 6e | 67 20 65 78 65 63 75 74 |ed durin|g execut|
|000013a0| 69 6f 6e 20 6f 66 20 61 | 20 50 72 6f 6c 6f 67 20 |ion of a| Prolog |
|000013b0| 70 72 6f 67 72 61 6d 2e | 20 47 65 6e 65 72 61 6c |program.| General|
|000013c0| 6c 79 20 74 68 65 20 70 | 72 65 64 69 63 61 74 65 |ly the p|redicate|
|000013d0| 20 77 69 6c 6c 20 67 65 | 74 20 61 6e 64 20 72 65 | will ge|t and re|
|000013e0| 74 75 72 6e 20 76 61 6c | 75 65 73 20 76 69 61 20 |turn val|ues via |
|000013f0| 74 68 65 20 70 61 72 61 | 6d 65 74 65 72 20 6c 69 |the para|meter li|
|00001400| 73 74 2e 20 54 68 65 20 | 70 72 65 64 69 63 61 74 |st. The |predicat|
|00001410| 65 20 69 6e 64 69 63 61 | 74 65 73 20 77 68 65 74 |e indica|tes whet|
|00001420| 68 65 72 20 61 20 73 75 | 63 63 65 73 73 66 75 6c |her a su|ccessful|
|00001430| 20 6f 72 20 75 6e 73 75 | 63 63 65 73 73 66 75 6c | or unsu|ccessful|
|00001440| 20 6f 75 74 63 6f 6d 65 | 20 73 68 6f 75 6c 64 20 | outcome| should |
|00001450| 72 65 73 75 6c 74 2c 20 | 61 6e 64 20 61 6c 73 6f |result, |and also|
|00001460| 20 77 68 65 74 68 65 72 | 20 74 68 65 20 5b 73 75 | whether| the [su|
|00001470| 63 63 65 73 73 66 75 6c | 5d 20 6f 75 74 63 6f 6d |ccessful|] outcom|
|00001480| 65 20 69 73 20 64 65 74 | 65 72 6d 69 6e 61 74 65 |e is det|erminate|
|00001490| 2e 20 43 75 72 72 65 6e | 74 6c 79 2c 20 6f 6e 6c |. Curren|tly, onl|
|000014a0| 79 20 64 65 74 65 72 6d | 69 6e 61 74 65 20 6f 75 |y determ|inate ou|
|000014b0| 74 63 6f 6d 65 73 20 61 | 72 65 20 73 75 70 70 6f |tcomes a|re suppo|
|000014c0| 72 74 65 64 2e 20 45 66 | 66 65 63 74 69 76 65 20 |rted. Ef|fective |
|000014d0| 66 72 6f 6d 20 4f 70 65 | 6e 20 50 72 6f 6c 6f 67 |from Ope|n Prolog|
|000014e0| 20 31 2e 30 64 33 37 2c | 20 61 20 70 72 65 64 69 | 1.0d37,| a predi|
|000014f0| 63 61 74 65 20 63 61 6e | 20 72 65 74 75 72 6e 20 |cate can| return |
|00001500| 61 6e 20 65 72 72 6f 72 | 20 63 6f 64 65 20 61 6e |an error| code an|
|00001510| 64 20 61 73 73 6f 63 69 | 61 74 65 64 20 65 72 72 |d associ|ated err|
|00001520| 6f 72 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 2e 20 |or infor|mation. |
|00001530| 54 68 65 20 65 72 72 6f | 72 20 63 6f 64 65 20 69 |The erro|r code i|
|00001540| 73 20 61 20 6e 75 6d 62 | 65 72 20 63 6f 72 72 65 |s a numb|er corre|
|00001550| 73 70 6f 6e 64 69 6e 67 | 20 74 6f 20 61 6e 20 49 |sponding| to an I|
|00001560| 53 4f 20 50 72 6f 6c 6f | 67 20 44 72 61 66 74 20 |SO Prolo|g Draft |
|00001570| 65 72 72 6f 72 20 74 79 | 70 65 20 28 73 79 73 74 |error ty|pe (syst|
|00001580| 65 6d 5f 65 72 72 6f 72 | 2c 20 64 6f 6d 61 69 6e |em_error|, domain|
|00001590| 5f 65 72 72 6f 72 2c 20 | 65 74 63 2e 20 77 69 74 |_error, |etc. wit|
|000015a0| 68 20 74 77 6f 20 61 64 | 64 69 74 69 6f 6e 73 20 |h two ad|ditions |
|000015b0| 2d 20 73 65 65 20 70 72 | 6c 78 44 65 66 69 6e 69 |- see pr|lxDefini|
|000015c0| 74 69 6f 6e 73 2e 70 29 | 2e 20 54 68 65 20 65 72 |tions.p)|. The er|
|000015d0| 72 6f 72 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |ror info|rmation |
|000015e0| 63 61 6e 20 62 65 20 61 | 6e 79 20 50 72 6f 6c 6f |can be a|ny Prolo|
|000015f0| 67 20 74 65 72 6d 2e 20 | 57 68 65 6e 20 61 6e 20 |g term. |When an |
|00001600| 65 72 72 6f 72 20 68 61 | 73 20 62 65 65 6e 20 73 |error ha|s been s|
|00001610| 69 67 6e 61 6c 6c 65 64 | 2c 20 75 70 6f 6e 20 73 |ignalled|, upon s|
|00001620| 75 62 73 65 71 75 65 6e | 74 20 65 78 69 74 20 66 |ubsequen|t exit f|
|00001630| 72 6f 6d 20 74 68 65 20 | 70 72 65 64 69 63 61 74 |rom the |predicat|
|00001640| 65 2c 20 61 6e 20 65 72 | 72 6f 72 20 6d 65 73 73 |e, an er|ror mess|
|00001650| 61 67 65 20 6f 66 20 74 | 68 65 20 66 6f 6c 6c 6f |age of t|he follo|
|00001660| 77 69 6e 67 20 66 6f 72 | 6d 20 69 73 20 74 68 72 |wing for|m is thr|
|00001670| 6f 77 6e 3a 0d 65 72 72 | 6f 72 28 3c 65 72 72 6f |own:.err|or(<erro|
|00001680| 72 20 74 79 70 65 3e 2c | 3c 65 72 72 6f 72 20 69 |r type>,|<error i|
|00001690| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 74 65 72 6d 3e |nformati|on term>|
|000016a0| 29 2e 0d 49 6e 20 74 68 | 65 20 70 72 6c 78 4c 69 |)..In th|e prlxLi|
|000016b0| 62 72 61 72 69 65 73 20 | 61 63 63 6f 6d 70 61 6e |braries |accompan|
|000016c0| 79 69 6e 67 20 74 68 69 | 73 20 72 65 6c 65 61 73 |ying thi|s releas|
|000016d0| 65 2c 20 74 68 65 72 65 | 20 69 73 20 61 20 72 6f |e, there| is a ro|
|000016e0| 75 74 69 6e 65 3a 0d 73 | 69 67 6e 61 6c 45 72 72 |utine:.s|ignalErr|
|000016f0| 6f 72 28 65 72 72 6f 72 | 43 6f 64 65 2c 61 72 67 |or(error|Code,arg|
|00001700| 75 6d 65 6e 74 49 6e 64 | 65 78 2c 68 6f 73 74 45 |umentInd|ex,hostE|
|00001710| 72 72 6f 72 43 6f 64 65 | 2c 65 72 72 6f 72 4d 65 |rrorCode|,errorMe|
|00001720| 73 73 61 67 65 2c 70 6c | 69 73 74 29 2e 0d 54 68 |ssage,pl|ist)..Th|
|00001730| 69 73 20 77 69 6c 6c 20 | 73 69 67 6e 61 6c 20 61 |is will |signal a|
|00001740| 6e 20 65 72 72 6f 72 20 | 74 79 70 65 20 61 6e 64 |n error |type and|
|00001750| 20 66 6f 72 6d 20 61 6e | 20 65 72 72 6f 72 20 69 | form an| error i|
|00001760| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 74 65 72 6d 2c |nformati|on term,|
|00001770| 20 67 69 76 69 6e 67 20 | 74 68 65 20 66 6f 6c 6c | giving |the foll|
|00001780| 6f 77 69 6e 67 20 6c 61 | 79 6f 75 74 20 74 6f 20 |owing la|yout to |
|00001790| 74 68 65 20 65 72 72 6f | 72 20 74 68 72 6f 77 6e |the erro|r thrown|
|000017a0| 3a 0d 65 72 72 6f 72 28 | 3c 65 72 72 6f 72 20 74 |:.error(|<error t|
|000017b0| 79 70 65 3e 2c 0d 20 20 | 20 20 20 20 20 5b 67 6f |ype>,. | [go|
|000017c0| 61 6c 28 43 61 6c 6c 41 | 6e 64 49 74 73 41 72 67 |al(CallA|ndItsArg|
|000017d0| 75 6d 65 6e 74 73 29 2c | 61 72 67 75 6d 65 6e 74 |uments),|argument|
|000017e0| 5f 69 6e 64 65 78 28 61 | 72 67 75 6d 65 6e 74 49 |_index(a|rgumentI|
|000017f0| 6e 64 65 78 29 2c 0d 20 | 20 20 20 20 20 20 68 6f |ndex),. | ho|
|00001800| 73 74 5f 65 72 72 6f 72 | 5f 63 6f 64 65 28 68 6f |st_error|_code(ho|
|00001810| 73 74 45 72 72 6f 72 43 | 6f 64 65 29 2c 65 72 72 |stErrorC|ode),err|
|00001820| 6f 72 5f 6d 65 73 73 61 | 67 65 28 45 72 72 6f 72 |or_messa|ge(Error|
|00001830| 4d 65 73 73 61 67 65 41 | 74 6f 6d 29 5d 29 2e 0d |MessageA|tom)])..|
|00001840| 54 68 65 20 61 72 67 75 | 6d 65 6e 74 5f 69 6e 64 |The argu|ment_ind|
|00001850| 65 78 20 61 6e 64 20 68 | 6f 73 74 5f 65 72 72 6f |ex and h|ost_erro|
|00001860| 72 5f 63 6f 64 65 20 74 | 65 72 6d 73 20 61 72 65 |r_code t|erms are|
|00001870| 20 6f 6d 69 74 74 65 64 | 20 69 66 20 74 68 65 20 | omitted| if the |
|00001880| 6e 75 6d 62 65 72 73 20 | 61 72 65 20 7a 65 72 6f |numbers |are zero|
|00001890| 2c 20 61 6e 64 20 74 68 | 65 20 6d 65 73 73 61 67 |, and th|e messag|
|000018a0| 65 20 74 65 72 6d 20 69 | 73 20 6f 6d 69 74 74 65 |e term i|s omitte|
|000018b0| 64 20 69 66 20 74 68 65 | 20 6d 65 73 73 61 67 65 |d if the| message|
|000018c0| 20 73 74 72 69 6e 67 20 | 69 73 20 65 6d 70 74 79 | string |is empty|
|000018d0| 2e 20 54 68 65 20 67 6f | 61 6c 20 69 73 20 6f 6d |. The go|al is om|
|000018e0| 69 74 74 65 64 20 69 66 | 20 74 68 65 20 61 72 67 |itted if| the arg|
|000018f0| 75 6d 65 6e 74 20 69 6e | 64 65 78 20 69 73 20 2d |ument in|dex is -|
|00001900| 31 2e 0d 0d a1 20 43 6c | 6f 73 65 64 6f 77 6e 20 |1.... Cl|osedown |
|00001910| 50 68 61 73 65 3a 0d 54 | 68 69 73 20 69 73 20 73 |Phase:.T|his is s|
|00001920| 75 70 70 6f 73 65 64 20 | 74 6f 20 74 65 6c 6c 20 |upposed |to tell |
|00001930| 65 61 63 68 20 70 72 65 | 64 69 63 61 74 65 20 74 |each pre|dicate t|
|00001940| 6f 20 66 69 6e 69 73 68 | 20 69 74 73 20 62 75 73 |o finish| its bus|
|00001950| 69 6e 65 73 73 20 70 72 | 69 6f 72 20 74 6f 20 71 |iness pr|ior to q|
|00001960| 75 69 74 74 69 6e 67 20 | 50 72 6f 6c 6f 67 2e 20 |uitting |Prolog. |
|00001970| 49 74 20 68 61 73 6e 27 | 74 20 62 65 65 6e 20 69 |It hasn'|t been i|
|00001980| 6d 70 6c 65 6d 65 6e 74 | 65 64 20 79 65 74 2e 0d |mplement|ed yet..|
|00001990| 0d 0d d7 20 57 69 6e 64 | 6f 77 20 44 72 69 76 65 |... Wind|ow Drive|
|000019a0| 6e 20 4f 70 65 72 61 74 | 69 6f 6e 0d 49 66 20 79 |n Operat|ion.If y|
|000019b0| 6f 75 72 20 70 72 65 64 | 69 63 61 74 65 20 27 6f |our pred|icate 'o|
|000019c0| 77 6e 73 27 20 61 6e 79 | 20 77 69 6e 64 6f 77 73 |wns' any| windows|
|000019d0| 2c 20 74 68 65 6e 20 69 | 74 20 6d 75 73 74 20 62 |, then i|t must b|
|000019e0| 65 20 63 61 70 61 62 6c | 65 20 6f 66 20 72 65 73 |e capabl|e of res|
|000019f0| 70 6f 6e 64 69 6e 67 20 | 74 6f 20 77 69 6e 64 6f |ponding |to windo|
|00001a00| 77 2d 72 65 6c 61 74 65 | 64 20 65 76 65 6e 74 73 |w-relate|d events|
|00001a10| 2e 20 57 68 65 6e 65 76 | 65 72 20 4f 70 65 6e 20 |. Whenev|er Open |
|00001a20| 50 72 6f 6c 6f 67 20 72 | 65 73 70 6f 6e 64 73 20 |Prolog r|esponds |
|00001a30| 74 6f 20 61 20 77 69 6e | 64 6f 77 2d 72 65 6c 61 |to a win|dow-rela|
|00001a40| 74 65 64 20 65 76 65 6e | 74 2c 20 69 74 20 63 61 |ted even|t, it ca|
|00001a50| 6c 6c 73 20 74 68 65 20 | 66 75 6e 63 74 69 6f 6e |lls the |function|
|00001a60| 20 77 68 6f 73 65 20 61 | 64 64 72 65 73 73 20 69 | whose a|ddress i|
|00001a70| 73 20 69 6e 20 74 68 65 | 20 72 65 66 43 6f 6e 20 |s in the| refCon |
|00001a80| 66 69 65 6c 64 20 6f 66 | 20 74 68 65 20 77 69 6e |field of| the win|
|00001a90| 64 6f 77 20 63 6f 6e 63 | 65 72 6e 65 64 2e 20 59 |dow conc|erned. Y|
|00001aa0| 6f 75 20 6d 75 73 74 20 | 73 75 70 70 6c 79 20 74 |ou must |supply t|
|00001ab0| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 66 6f 72 |his func|tion for|
|00001ac0| 20 79 6f 75 72 20 77 69 | 6e 64 6f 77 28 73 29 2e | your wi|ndow(s).|
|00001ad0| 20 54 68 65 20 70 61 72 | 61 6d 65 74 65 72 20 73 | The par|ameter s|
|00001ae0| 63 68 65 6d 65 20 66 6f | 72 20 74 68 65 20 66 75 |cheme fo|r the fu|
|00001af0| 6e 63 74 69 6f 6e 20 6d | 75 73 74 20 68 61 76 65 |nction m|ust have|
|00001b00| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 66 | the fol|lowing f|
|00001b10| 6f 72 6d 3a 0d 20 20 20 | 20 0d 46 55 4e 43 54 49 |orm:. | .FUNCTI|
|00001b20| 4f 4e 20 66 6f 6f 28 74 | 68 65 57 69 6e 64 6f 77 |ON foo(t|heWindow|
|00001b30| 3a 20 77 69 6e 64 6f 77 | 50 74 72 3b 0d 20 20 20 |: window|Ptr;. |
|00001b40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001b50| 20 20 20 20 20 20 70 61 | 72 61 6d 65 74 65 72 3a | pa|rameter:|
|00001b60| 20 6c 6f 6e 67 69 6e 74 | 3b 0d 20 20 20 20 20 20 | longint|;. |
|00001b70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001b80| 20 20 20 6d 65 73 73 61 | 67 65 3a 20 69 6e 74 65 | messa|ge: inte|
|00001b90| 67 65 72 29 3a 20 6c 6f | 6e 67 69 6e 74 3b 0d 0d |ger): lo|ngint;..|
|00001ba0| 54 68 65 20 74 68 65 57 | 69 6e 64 6f 77 20 66 69 |The theW|indow fi|
|00001bb0| 65 6c 64 20 77 69 6c 6c | 20 68 61 76 65 20 74 68 |eld will| have th|
|00001bc0| 65 20 61 64 64 72 65 73 | 73 20 6f 66 20 74 68 65 |e addres|s of the|
|00001bd0| 20 77 69 6e 64 6f 77 20 | 63 6f 6e 63 65 72 6e 65 | window |concerne|
|00001be0| 64 2e 20 54 68 65 20 70 | 61 72 61 6d 65 74 65 72 |d. The p|arameter|
|00001bf0| 20 66 69 65 6c 64 20 6d | 61 79 20 68 61 76 65 20 | field m|ay have |
|00001c00| 72 65 6c 65 76 61 6e 74 | 20 69 6e 66 6f 72 6d 61 |relevant| informa|
|00001c10| 74 69 6f 6e 20 28 65 2e | 67 2e 20 4d 65 6e 75 20 |tion (e.|g. Menu |
|00001c20| 43 6f 6f 72 64 69 6e 61 | 74 65 73 29 2e 20 47 72 |Coordina|tes). Gr|
|00001c30| 65 61 74 20 64 6f 63 75 | 6d 65 6e 74 61 74 69 6f |eat docu|mentatio|
|00001c40| 6e 2c 20 69 73 6e 27 74 | 20 69 74 3f 0d 54 68 65 |n, isn't| it?.The|
|00001c50| 20 6d 65 73 73 61 67 65 | 20 66 69 65 6c 64 20 63 | message| field c|
|00001c60| 6f 6e 74 61 69 6e 73 20 | 61 6e 20 65 76 65 6e 74 |ontains |an event|
|00001c70| c9 20 63 6f 64 65 20 69 | 6e 64 69 63 61 74 69 6e |. code i|ndicatin|
|00001c80| 67 20 74 68 65 20 6b 69 | 6e 64 20 6f 66 20 65 76 |g the ki|nd of ev|
|00001c90| 65 6e 74 2e 20 4c 6f 6f | 6b 20 69 6e 20 70 72 6c |ent. Loo|k in prl|
|00001ca0| 78 44 65 66 69 6e 69 74 | 69 6f 6e 73 2e 70 20 66 |xDefinit|ions.p f|
|00001cb0| 6f 72 20 74 68 65 20 63 | 6f 64 65 73 2e 20 55 73 |or the c|odes. Us|
|00001cc0| 75 61 6c 6c 79 20 79 6f | 75 20 72 65 74 75 72 6e |ually yo|u return|
|00001cd0| 20 27 6d 65 73 73 61 67 | 65 4f 4b 27 20 66 6f 72 | 'messag|eOK' for|
|00001ce0| 20 74 68 65 20 66 75 6e | 63 74 69 6f 6e 27 73 20 | the fun|ction's |
|00001cf0| 76 61 6c 75 65 2e 20 41 | 74 20 61 20 76 65 72 79 |value. A|t a very|
|00001d00| 20 6d 69 6e 69 6d 75 6d | 2c 20 79 6f 75 72 20 66 | minimum|, your f|
|00001d10| 75 6e 63 74 69 6f 6e 20 | 73 68 6f 75 6c 64 20 72 |unction |should r|
|00001d20| 65 73 70 6f 6e 64 20 74 | 6f 20 65 76 65 6e 74 55 |espond t|o eventU|
|00001d30| 70 64 61 74 65 20 61 6e | 64 20 65 76 65 6e 74 41 |pdate an|d eventA|
|00001d40| 63 74 69 76 61 74 65 20 | 28 26 20 64 65 61 63 74 |ctivate |(& deact|
|00001d50| 69 76 61 74 65 29 20 65 | 76 65 6e 74 73 2e 0d 57 |ivate) e|vents..W|
|00001d60| 69 6e 64 6f 77 2d 64 72 | 69 76 65 6e 20 6f 70 65 |indow-dr|iven ope|
|00001d70| 72 61 74 69 6f 6e 20 6f | 63 63 75 72 73 20 61 73 |ration o|ccurs as|
|00001d80| 79 6e 63 68 72 6f 6e 6f | 75 73 6c 79 20 77 69 74 |ynchrono|usly wit|
|00001d90| 68 20 72 65 73 70 65 63 | 74 20 74 6f 20 74 68 65 |h respec|t to the|
|00001da0| 20 6f 70 65 72 61 74 69 | 6f 6e 20 6f 66 20 4f 70 | operati|on of Op|
|00001db0| 65 6e 20 50 72 6f 6c 6f | 67 2c 20 73 6f 20 63 61 |en Prolo|g, so ca|
|00001dc0| 6c 6c 62 61 63 6b 20 63 | 6f 6d 6d 61 6e 64 73 20 |llback c|ommands |
|00001dd0| 61 72 65 20 6e 6f 74 20 | 61 76 61 69 6c 61 62 6c |are not |availabl|
|00001de0| 65 20 64 75 72 69 6e 67 | 20 77 69 6e 64 6f 77 2d |e during| window-|
|00001df0| 64 72 69 76 65 6e 20 6f | 70 65 72 61 74 69 6f 6e |driven o|peration|
|00001e00| 2e 0d 0d 0d d7 20 45 76 | 65 6e 74 20 44 72 69 76 |..... Ev|ent Driv|
|00001e10| 65 6e 20 4f 70 65 72 61 | 74 69 6f 6e 0d 59 6f 75 |en Opera|tion.You|
|00001e20| 20 63 61 6e 20 6e 6f 6d | 69 6e 61 74 65 20 61 20 | can nom|inate a |
|00001e30| 66 75 6e 63 74 69 6f 6e | 20 74 6f 20 73 65 65 20 |function| to see |
|00001e40| 65 76 65 6e 74 73 20 63 | 6f 6d 69 6e 67 20 69 6e |events c|oming in|
|00001e50| 20 74 6f 20 4f 70 65 6e | 20 50 72 6f 6c 6f 67 20 | to Open| Prolog |
|00001e60| 62 65 66 6f 72 65 20 74 | 68 65 79 20 61 72 65 20 |before t|hey are |
|00001e70| 70 72 6f 63 65 73 73 65 | 64 2e 20 54 68 69 73 20 |processe|d. This |
|00001e80| 69 73 20 64 6f 6e 65 20 | 62 79 20 65 78 65 63 75 |is done |by execu|
|00001e90| 74 69 6e 67 20 61 20 27 | 73 65 6e 64 45 76 65 6e |ting a '|sendEven|
|00001ea0| 74 73 27 20 63 61 6c 6c | 62 61 63 6b 20 63 6f 6d |ts' call|back com|
|00001eb0| 6d 61 6e 64 20 77 68 69 | 6c 65 20 79 6f 75 72 20 |mand whi|le your |
|00001ec0| 70 72 65 64 69 63 61 74 | 65 20 69 73 20 69 6e 69 |predicat|e is ini|
|00001ed0| 74 69 61 6c 69 73 69 6e | 67 2e 20 28 53 65 65 20 |tialisin|g. (See |
|00001ee0| 74 68 65 20 65 78 61 6d | 70 6c 65 20 63 6f 75 6e |the exam|ple coun|
|00001ef0| 74 48 4c 45 2e 70 2e 29 | 20 59 6f 75 20 6d 75 73 |tHLE.p.)| You mus|
|00001f00| 74 20 70 72 6f 76 69 64 | 65 20 74 68 65 20 61 64 |t provid|e the ad|
|00001f10| 64 72 65 73 73 20 6f 66 | 20 61 20 66 75 6e 63 74 |dress of| a funct|
|00001f20| 69 6f 6e 20 69 6e 20 63 | 61 6c 6c 62 61 63 6b 44 |ion in c|allbackD|
|00001f30| 61 74 61 5b 31 5d 20 61 | 6e 64 20 79 6f 75 20 63 |ata[1] a|nd you c|
|00001f40| 61 6e 20 70 72 6f 76 69 | 64 65 20 70 65 72 6d 61 |an provi|de perma|
|00001f50| 6e 65 6e 74 20 64 61 74 | 61 20 2d 20 27 79 6f 75 |nent dat|a - 'you|
|00001f60| 72 44 61 74 61 27 20 2d | 20 69 6e 20 63 61 6c 6c |rData' -| in call|
|00001f70| 62 61 63 6b 44 61 74 61 | 5b 32 5d 2e 20 54 68 65 |backData|[2]. The|
|00001f80| 6e 2c 20 66 6f 72 20 65 | 76 65 72 79 20 65 76 65 |n, for e|very eve|
|00001f90| 6e 74 2c 20 79 6f 75 72 | 20 66 75 6e 63 74 69 6f |nt, your| functio|
|00001fa0| 6e 20 77 69 6c 6c 20 62 | 65 20 63 61 6c 6c 65 64 |n will b|e called|
|00001fb0| 2c 20 61 63 63 6f 72 64 | 69 6e 67 20 74 6f 20 74 |, accord|ing to t|
|00001fc0| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 73 63 68 |he follo|wing sch|
|00001fd0| 65 6d 65 3a 0d 0d 46 55 | 4e 43 54 49 4f 4e 20 66 |eme:..FU|NCTION f|
|00001fe0| 6f 6f 28 79 6f 75 72 44 | 61 74 61 3a 6c 6f 6e 67 |oo(yourD|ata:long|
|00001ff0| 69 6e 74 3b 74 68 65 45 | 76 65 6e 74 3a 65 76 65 |int;theE|vent:eve|
|00002000| 6e 74 50 74 72 29 3a 6c | 6f 6e 67 69 6e 74 3b 0d |ntPtr):l|ongint;.|
|00002010| 0d a1 20 79 6f 75 72 44 | 61 74 61 20 69 73 20 61 |.. yourD|ata is a|
|00002020| 20 6c 6f 6e 67 69 6e 74 | 2e 20 4e 6f 74 69 63 65 | longint|. Notice|
|00002030| 20 74 68 61 74 20 69 74 | 27 73 20 6e 6f 74 20 61 | that it|'s not a|
|00002040| 20 56 41 52 20 70 61 72 | 61 6d 65 74 65 72 2c 20 | VAR par|ameter, |
|00002050| 73 6f 20 79 6f 75 20 63 | 61 6e 27 74 20 61 6c 74 |so you c|an't alt|
|00002060| 65 72 20 69 74 20 64 69 | 72 65 63 74 6c 79 2e 20 |er it di|rectly. |
|00002070| 54 79 70 69 63 61 6c 6c | 79 2c 20 69 74 20 77 6f |Typicall|y, it wo|
|00002080| 75 6c 64 20 62 65 20 61 | 20 68 61 6e 64 6c 65 20 |uld be a| handle |
|00002090| 74 6f 20 61 20 64 61 74 | 61 20 73 74 72 75 63 74 |to a dat|a struct|
|000020a0| 75 72 65 2e 0d 0d a1 20 | 74 68 65 45 76 65 6e 74 |ure.... |theEvent|
|000020b0| 20 69 73 20 61 20 70 6f | 69 6e 74 65 72 20 74 6f | is a po|inter to|
|000020c0| 20 74 68 65 20 65 76 65 | 6e 74 20 72 65 63 6f 72 | the eve|nt recor|
|000020d0| 64 2e 20 59 6f 75 20 63 | 61 6e 20 65 78 61 6d 69 |d. You c|an exami|
|000020e0| 6e 65 20 74 68 65 20 66 | 69 65 6c 64 73 2c 20 62 |ne the f|ields, b|
|000020f0| 75 74 20 64 6f 6e 27 74 | 20 63 68 61 6e 67 65 20 |ut don't| change |
|00002100| 61 6e 79 20 6f 66 20 74 | 68 65 6d 20 62 65 63 61 |any of t|hem beca|
|00002110| 75 73 65 20 74 68 65 79 | 20 61 72 65 20 75 73 65 |use they| are use|
|00002120| 64 20 62 79 20 4f 70 65 | 6e 20 50 72 6f 6c 6f 67 |d by Ope|n Prolog|
|00002130| 20 69 74 73 65 6c 66 2e | 0d 0d 49 66 20 79 6f 75 | itself.|..If you|
|00002140| 20 77 61 6e 74 20 6e 6f | 72 6d 61 6c 20 70 72 6f | want no|rmal pro|
|00002150| 63 65 73 73 69 6e 67 20 | 6f 66 20 74 68 65 20 65 |cessing |of the e|
|00002160| 76 65 6e 74 20 74 6f 20 | 6f 63 63 75 72 20 61 66 |vent to |occur af|
|00002170| 74 65 72 20 79 6f 75 72 | 20 66 75 6e 63 74 69 6f |ter your| functio|
|00002180| 6e 20 68 61 73 20 73 65 | 65 6e 20 69 74 2c 20 74 |n has se|en it, t|
|00002190| 68 65 6e 20 72 65 74 75 | 72 6e 20 74 68 65 20 76 |hen retu|rn the v|
|000021a0| 61 6c 75 65 20 27 6d 65 | 73 73 61 67 65 4e 6f 52 |alue 'me|ssageNoR|
|000021b0| 65 70 6c 79 27 2e 20 49 | 66 20 79 6f 75 72 20 66 |eply'. I|f your f|
|000021c0| 75 6e 63 74 69 6f 6e 20 | 74 61 6b 65 73 20 63 61 |unction |takes ca|
|000021d0| 72 65 20 6f 66 20 69 74 | 20 63 6f 6d 70 6c 65 74 |re of it| complet|
|000021e0| 65 6c 79 2c 20 61 6e 64 | 20 6e 6f 74 68 69 6e 67 |ely, and| nothing|
|000021f0| 20 66 75 72 74 68 65 72 | 20 6e 65 65 64 73 20 74 | further| needs t|
|00002200| 6f 20 62 65 20 64 6f 6e | 65 20 62 79 20 4f 70 65 |o be don|e by Ope|
|00002210| 6e 20 50 72 6f 6c 6f 67 | 2c 20 74 68 65 6e 20 72 |n Prolog|, then r|
|00002220| 65 74 75 72 6e 20 27 6d | 65 73 73 61 67 65 4f 4b |eturn 'm|essageOK|
|00002230| 27 2e 20 49 66 20 79 6f | 75 72 20 66 75 6e 63 74 |'. If yo|ur funct|
|00002240| 69 6f 6e 20 72 65 74 75 | 72 6e 73 20 27 6d 65 73 |ion retu|rns 'mes|
|00002250| 73 61 67 65 51 75 69 74 | 27 2c 20 6f 72 20 27 6d |sageQuit|', or 'm|
|00002260| 65 73 73 61 67 65 45 72 | 72 6f 72 27 2c 20 67 75 |essageEr|ror', gu|
|00002270| 65 73 73 20 77 68 61 74 | 3f 0d 49 66 20 79 6f 75 |ess what|?.If you|
|00002280| 20 61 72 65 20 68 61 6e | 64 6c 69 6e 67 20 68 69 | are han|dling hi|
|00002290| 67 68 2d 6c 65 76 65 6c | 20 65 76 65 6e 74 73 20 |gh-level| events |
|000022a0| 75 73 69 6e 67 20 61 6e | 20 65 78 74 65 72 6e 61 |using an| externa|
|000022b0| 6c 20 70 72 65 64 69 63 | 61 74 65 2c 20 62 65 20 |l predic|ate, be |
|000022c0| 63 61 72 65 66 75 6c 20 | 6e 6f 74 20 74 6f 20 73 |careful |not to s|
|000022d0| 65 6e 64 20 62 6f 67 75 | 73 20 72 65 70 6c 69 65 |end bogu|s replie|
|000022e0| 73 20 74 6f 20 74 68 65 | 20 65 76 65 6e 74 73 20 |s to the| events |
|000022f0| 74 68 61 74 20 79 6f 75 | 72 20 68 61 6e 64 6c 65 |that you|r handle|
|00002300| 72 20 64 6f 65 73 6e 27 | 74 20 70 72 6f 63 65 73 |r doesn'|t proces|
|00002310| 73 2e 20 41 70 70 61 72 | 65 6e 74 6c 79 2c 20 66 |s. Appar|ently, f|
|00002320| 72 6f 6d 20 49 4d 20 56 | 36 2c 20 69 66 20 79 6f |rom IM V|6, if yo|
|00002330| 75 20 64 69 73 70 61 74 | 63 68 20 74 6f 20 79 6f |u dispat|ch to yo|
|00002340| 75 72 20 48 4c 45 20 63 | 6f 64 65 20 69 6e 20 74 |ur HLE c|ode in t|
|00002350| 68 65 20 61 70 70 72 6f | 76 65 64 20 6d 61 6e 6e |he appro|ved mann|
|00002360| 65 72 2c 20 61 6e 64 20 | 69 66 20 74 68 65 20 64 |er, and |if the d|
|00002370| 69 73 70 61 74 63 68 20 | 74 61 62 6c 65 20 68 61 |ispatch |table ha|
|00002380| 73 20 6e 6f 20 65 6e 74 | 72 79 20 66 6f 72 20 74 |s no ent|ry for t|
|00002390| 68 65 20 70 61 72 74 69 | 63 75 6c 61 72 20 65 76 |he parti|cular ev|
|000023a0| 65 6e 74 2c 20 74 68 65 | 6e 20 61 20 6d 65 73 73 |ent, the|n a mess|
|000023b0| 61 67 65 20 77 69 6c 6c | 20 62 65 20 73 65 6e 74 |age will| be sent|
|000023c0| 20 62 61 63 6b 20 74 6f | 20 74 68 65 20 73 65 6e | back to| the sen|
|000023d0| 64 65 72 20 69 6e 64 69 | 63 61 74 69 6e 67 20 74 |der indi|cating t|
|000023e0| 68 65 20 65 76 65 6e 74 | 20 63 61 6e 27 74 20 62 |he event| can't b|
|000023f0| 65 20 68 61 6e 64 6c 65 | 64 2e 20 54 68 69 73 20 |e handle|d. This |
|00002400| 69 73 20 69 6e 61 70 70 | 72 6f 70 72 69 61 74 65 |is inapp|ropriate|
|00002410| 20 69 6e 20 74 68 65 20 | 63 6f 6e 74 65 78 74 20 | in the |context |
|00002420| 6f 66 20 4f 70 65 6e 20 | 50 72 6f 6c 6f 67 2c 20 |of Open |Prolog, |
|00002430| 62 65 63 61 75 73 65 20 | 4f 50 20 69 74 73 65 6c |because |OP itsel|
|00002440| 66 20 6d 69 67 68 74 20 | 68 61 6e 64 6c 65 20 69 |f might |handle i|
|00002450| 74 2e 20 53 6f 20 74 68 | 65 20 6d 65 73 73 61 67 |t. So th|e messag|
|00002460| 65 20 69 73 3a 20 6f 6e | 6c 79 20 61 63 63 65 70 |e is: on|ly accep|
|00002470| 74 20 66 6f 72 20 70 72 | 6f 63 65 73 73 69 6e 67 |t for pr|ocessing|
|00002480| 20 74 68 6f 73 65 20 65 | 76 65 6e 74 73 20 79 6f | those e|vents yo|
|00002490| 75 20 61 72 65 20 63 65 | 72 74 61 69 6e 20 79 6f |u are ce|rtain yo|
|000024a0| 75 20 63 61 6e 20 68 61 | 6e 64 6c 65 2e 0d 53 69 |u can ha|ndle..Si|
|000024b0| 6d 69 6c 61 72 6c 79 20 | 74 6f 20 77 69 6e 64 6f |milarly |to windo|
|000024c0| 77 2d 64 72 69 76 65 6e | 20 6f 70 65 72 61 74 69 |w-driven| operati|
|000024d0| 6f 6e 2c 20 65 76 65 6e | 74 2d 64 72 69 76 65 6e |on, even|t-driven|
|000024e0| 20 6f 70 65 72 61 74 69 | 6f 6e 20 6f 63 63 75 72 | operati|on occur|
|000024f0| 73 20 61 73 79 6e 63 68 | 72 6f 6e 6f 75 73 6c 79 |s asynch|ronously|
|00002500| 20 77 69 74 68 20 72 65 | 73 70 65 63 74 20 74 6f | with re|spect to|
|00002510| 20 74 68 65 20 6f 70 65 | 72 61 74 69 6f 6e 20 6f | the ope|ration o|
|00002520| 66 20 4f 70 65 6e 20 50 | 72 6f 6c 6f 67 2c 20 73 |f Open P|rolog, s|
|00002530| 6f 20 63 61 6c 6c 62 61 | 63 6b 20 63 6f 6d 6d 61 |o callba|ck comma|
|00002540| 6e 64 73 20 61 72 65 20 | 6e 6f 74 20 61 76 61 69 |nds are |not avai|
|00002550| 6c 61 62 6c 65 20 64 75 | 72 69 6e 67 20 65 76 65 |lable du|ring eve|
|00002560| 6e 74 2d 64 72 69 76 65 | 6e 20 6f 70 65 72 61 74 |nt-drive|n operat|
|00002570| 69 6f 6e 2e 0d 0d 4e 6f | 74 65 3a 20 6f 6e 6c 79 |ion...No|te: only|
|00002580| 20 6f 6e 65 20 65 78 74 | 65 72 6e 61 6c 20 70 72 | one ext|ernal pr|
|00002590| 65 64 69 63 61 74 65 20 | 63 61 6e 20 62 65 20 6e |edicate |can be n|
|000025a0| 6f 6d 69 6e 61 74 65 64 | 20 66 6f 72 20 72 65 63 |ominated| for rec|
|000025b0| 65 69 76 69 6e 67 20 65 | 76 65 6e 74 73 2e 20 4d |eiving e|vents. M|
|000025c0| 61 6b 65 20 73 75 72 65 | 20 74 68 65 72 65 20 61 |ake sure| there a|
|000025d0| 72 65 20 6e 6f 20 6f 74 | 68 65 72 73 20 28 75 73 |re no ot|hers (us|
|000025e0| 65 20 52 65 73 45 64 69 | 74 29 20 2d 20 79 6f 75 |e ResEdi|t) - you|
|000025f0| 27 6c 6c 20 6e 65 65 64 | 20 74 6f 20 72 65 6d 6f |'ll need| to remo|
|00002600| 76 65 20 74 68 65 20 50 | 52 4c 58 20 72 65 73 6f |ve the P|RLX reso|
|00002610| 75 72 63 65 20 6e 75 6d | 62 65 72 20 31 33 38 2c |urce num|ber 138,|
|00002620| 20 63 61 6c 6c 65 64 20 | 63 6f 75 6e 74 48 4c 45 | called |countHLE|
|00002630| 2c 20 77 68 65 6e 20 79 | 6f 75 20 73 74 61 72 74 |, when y|ou start|
|00002640| 20 62 75 69 6c 64 69 6e | 67 20 79 6f 75 72 20 6f | buildin|g your o|
|00002650| 77 6e 2e 0d 0d 0d a5 20 | 54 68 65 20 45 78 61 6d |wn..... |The Exam|
|00002660| 70 6c 65 73 0d 41 20 67 | 6f 6f 64 20 77 61 79 20 |ples.A g|ood way |
|00002670| 74 6f 20 73 74 61 72 74 | 20 6d 69 67 68 74 20 62 |to start| might b|
|00002680| 65 20 74 6f 20 63 6f 70 | 79 20 61 6e 20 65 78 69 |e to cop|y an exi|
|00002690| 73 74 69 6e 67 20 65 78 | 61 6d 70 6c 65 2e 20 54 |sting ex|ample. T|
|000026a0| 68 65 72 65 20 61 72 65 | 20 74 68 72 65 65 3a 20 |here are| three: |
|000026b0| 73 6f 75 6e 64 50 6c 61 | 79 2e 70 2c 0d 63 6f 75 |soundPla|y.p,.cou|
|000026c0| 6e 74 48 4c 45 2e 70 20 | 61 6e 64 20 64 72 61 77 |ntHLE.p |and draw|
|000026d0| 2e 70 2e 0d 0d d7 20 73 | 6f 75 6e 64 50 6c 61 79 |.p.... s|oundPlay|
|000026e0| 20 69 73 20 74 68 65 20 | 73 69 6d 70 6c 65 73 74 | is the |simplest|
|000026f0| 20 65 78 61 6d 70 6c 65 | 2e 20 49 74 20 70 6c 61 | example|. It pla|
|00002700| 79 73 20 61 6e 79 20 27 | 73 6e 64 20 27 20 72 65 |ys any '|snd ' re|
|00002710| 73 6f 75 72 63 65 20 61 | 76 61 69 6c 61 62 6c 65 |source a|vailable|
|00002720| 20 28 65 2e 67 2e 20 74 | 68 65 20 73 6f 75 6e 64 | (e.g. t|he sound|
|00002730| 73 20 61 76 61 69 6c 61 | 62 6c 65 20 69 6e 20 74 |s availa|ble in t|
|00002740| 68 65 20 53 6f 75 6e 64 | 20 43 6f 6e 74 72 6f 6c |he Sound| Control|
|00002750| 20 50 61 6e 65 6c 29 2e | 20 49 74 20 64 6f 65 73 | Panel).| It does|
|00002760| 6e 27 74 20 68 61 76 65 | 20 61 6e 79 20 77 69 6e |n't have| any win|
|00002770| 64 6f 77 20 6f 72 20 65 | 76 65 6e 74 20 64 72 69 |dow or e|vent dri|
|00002780| 76 65 6e 20 6f 70 65 72 | 61 74 69 6f 6e 2e 0d 0d |ven oper|ation...|
|00002790| d7 20 63 6f 75 6e 74 48 | 4c 45 20 69 73 20 61 20 |. countH|LE is a |
|000027a0| 73 69 6d 70 6c 65 20 70 | 72 65 64 69 63 61 74 65 |simple p|redicate|
|000027b0| 20 74 6f 20 63 6f 75 6e | 74 20 74 68 65 20 6e 75 | to coun|t the nu|
|000027c0| 6d 62 65 72 20 6f 66 20 | 63 6f 72 65 20 61 70 70 |mber of |core app|
|000027d0| 6c 65 45 76 65 6e 74 73 | 20 74 68 61 74 20 70 61 |leEvents| that pa|
|000027e0| 73 73 20 74 68 72 6f 75 | 67 68 20 74 68 65 20 70 |ss throu|gh the p|
|000027f0| 72 6f 67 72 61 6d 2e 20 | 49 74 20 64 65 66 69 6e |rogram. |It defin|
|00002800| 65 73 20 61 20 66 75 6e | 63 74 69 6f 6e 20 77 68 |es a fun|ction wh|
|00002810| 69 63 68 20 69 73 20 63 | 61 6c 6c 65 64 20 66 6f |ich is c|alled fo|
|00002820| 72 20 65 76 65 72 79 20 | 65 76 65 6e 74 2e 20 54 |r every |event. T|
|00002830| 68 65 20 66 75 6e 63 74 | 69 6f 6e 20 63 6f 6d 6d |he funct|ion comm|
|00002840| 75 6e 69 63 61 74 65 73 | 20 77 69 74 68 20 74 68 |unicates| with th|
|00002850| 65 20 70 72 65 64 69 63 | 61 74 65 20 74 68 72 6f |e predic|ate thro|
|00002860| 75 67 68 20 61 20 73 68 | 61 72 65 64 20 64 61 74 |ugh a sh|ared dat|
|00002870| 61 20 73 74 72 75 63 74 | 75 72 65 2e 0d 0d d7 20 |a struct|ure.... |
|00002880| 4f 70 65 6e 50 72 6f 6c | 6f 67 53 70 65 65 63 68 |OpenProl|ogSpeech|
|00002890| 20 63 6f 6e 74 61 69 6e | 73 20 74 77 6f 20 73 69 | contain|s two si|
|000028a0| 6d 70 6c 65 20 70 72 65 | 64 69 63 61 74 65 73 20 |mple pre|dicates |
|000028b0| 74 6f 20 75 73 65 20 74 | 68 65 20 53 6f 75 6e 64 |to use t|he Sound|
|000028c0| 20 4d 61 6e 61 67 65 72 | 2e 0d 0d d7 20 64 72 61 | Manager|.... dra|
|000028d0| 77 2e 70 20 69 73 20 61 | 20 66 61 69 72 6c 79 20 |w.p is a| fairly |
|000028e0| 63 6f 6d 70 6c 65 78 20 | 70 72 65 64 69 63 61 74 |complex |predicat|
|000028f0| 65 20 74 68 61 74 20 69 | 6d 70 6c 65 6d 65 6e 74 |e that i|mplement|
|00002900| 73 20 74 68 65 20 64 72 | 61 77 69 6e 67 20 63 6f |s the dr|awing co|
|00002910| 6d 6d 61 6e 64 73 20 64 | 65 73 63 72 69 62 65 64 |mmands d|escribed|
|00002920| 20 69 6e 20 74 68 65 20 | 72 65 6c 65 61 73 65 2e | in the |release.|
|00002930| 0d 0d 49 66 20 79 6f 75 | 20 75 73 65 20 61 20 63 |..If you| use a c|
|00002940| 6f 70 79 20 6f 66 20 74 | 68 65 20 65 78 61 6d 70 |opy of t|he examp|
|00002950| 6c 65 20 61 73 20 74 68 | 65 20 73 74 61 72 74 69 |le as th|e starti|
|00002960| 6e 67 20 70 6f 69 6e 74 | 20 66 6f 72 20 79 6f 75 |ng point| for you|
|00002970| 72 20 70 72 65 64 69 63 | 61 74 65 2c 20 63 6f 70 |r predic|ate, cop|
|00002980| 79 20 74 68 65 20 6d 61 | 6b 65 66 69 6c 65 20 65 |y the ma|kefile e|
|00002990| 6e 74 72 79 20 74 6f 6f | 20 2d 20 6a 75 73 74 20 |ntry too| - just |
|000029a0| 62 65 20 63 61 72 65 66 | 75 6c 20 74 6f 20 67 69 |be caref|ul to gi|
|000029b0| 76 65 20 79 6f 75 72 20 | 50 52 4c 58 20 73 65 67 |ve your |PRLX seg|
|000029c0| 6d 65 6e 74 20 61 20 6e | 65 77 20 49 44 20 6e 75 |ment a n|ew ID nu|
|000029d0| 6d 62 65 72 2e 20 53 65 | 65 20 61 6c 73 6f 20 74 |mber. Se|e also t|
|000029e0| 68 65 20 6e 6f 74 65 20 | 61 62 6f 76 65 20 61 62 |he note |above ab|
|000029f0| 6f 75 74 20 72 65 63 65 | 69 76 69 6e 67 20 65 76 |out rece|iving ev|
|00002a00| 65 6e 74 73 2e 0d 0d 00 | 00 00 00 00 00 00 00 00 |ents....|........|
|00002a10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a80| 00 00 01 00 00 00 01 30 | 00 00 00 30 00 00 00 32 |.......0|...0...2|
|00002a90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 42 45 47 | | BEG|
|00002aa0| 49 4e 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |IN. | |
|00002ab0| 19 41 62 6f 75 74 20 45 | 78 74 65 72 6e 61 6c 20 |.About E|xternal |
|00002ac0| 50 72 65 64 69 63 61 74 | 65 73 02 00 00 00 50 61 |Predicat|es....Pa|
|00002ad0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00002ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002af0| 00 00 a9 c7 3a 2d 00 00 | 00 00 00 00 01 62 74 65 |....:-..|.....bte|
|00002b00| 6d 28 64 69 61 6c 6f 67 | 50 74 72 28 64 61 74 61 |m(dialog|Ptr(data|
|00002b10| 5b 32 5d 29 2c 69 2b 35 | 29 3b 0d 20 20 20 20 20 |[2]),i+5|);. |
|00002b20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002b30| 20 20 20 20 20 45 4e 44 | 0d 20 20 20 20 20 20 20 | END|. |
|00002b40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002b50| 20 45 4c 53 45 0d 09 09 | 09 09 09 09 09 09 09 09 | ELSE...|........|
|00002b60| 09 09 62 65 67 69 6e 0d | 09 09 09 09 09 09 09 09 |..begin.|........|
|00002b70| 09 09 09 09 09 67 65 74 | 44 49 74 65 6d 28 64 69 |.....get|DItem(di|
|00002b80| 00 00 00 2c 01 02 80 08 | 00 00 05 31 2e 30 2e 32 |...,....|...1.0.2|
|00002b90| 1f 44 6f 63 75 6d 65 6e | 74 73 20 66 6f 72 20 4f |.Documen|ts for O|
|00002ba0| 70 65 6e 20 50 72 6f 6c | 6f 67 20 31 2e 30 2e 32 |pen Prol|og 1.0.2|
|00002bb0| 00 00 01 00 00 00 01 30 | 00 00 00 30 00 00 00 32 |.......0|...0...2|
|00002bc0| 00 46 73 f8 19 b6 00 00 | 00 1c 00 32 00 00 76 65 |.Fs.....|...2..ve|
|00002bd0| 72 73 00 00 00 0a 00 01 | ff ff 00 00 00 00 00 46 |rs......|.......F|
|00002be0| 73 8c 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |s.......|........|
|00002bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+